import java.sql.ResultSet;
import java.sql.SQLException;


public class Principal {
	public static boolean conectar;
	
	public static void main(String[] args) {
		
		
		
		 
		
		ClaseBDOracle BD = null;
		try {
			
			
			BD = new ClaseBDOracle("localhost:1521:xe","ventas","ventas");
			conectar = BD.Conectar();
			
		    ResultSet rs =  BD.GetConsulta ("SELECT * FROM COMPRA"); 
		    while (rs.next()) 
		    { 
		        System.out.println (rs.getInt (1) + " " + rs.getString (2)); 
		    }
		    
		    // anda de mil maravillas!!! 
		    //BD.insertarValores("INSERT INTO COMPRA (DNI,CODIGO) VALUES (36189908,005)");
		} catch (SQLException e) {
	
			e.printStackTrace();
		}
		
	
		

	}

}
